package com.ruoyi.system.xmlAbstract.interfaces.templateInterfaces.impl;

import com.ruoyi.system.xmlAbstract.XmlGenerateAbstract;
import com.ruoyi.system.xmlAbstract.impl.XmlBuild;
import com.ruoyi.system.xmlAbstract.interfaces.templateInterfaces.XmlTemplateInterface;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author : anxinr
 * @date : 2023/8/17 17:36
 */
@Scope("prototype")
@Component(value = "QQEmailH5XmlTemplate")
public class QQEmailH5XmlTemplate implements XmlTemplateInterface {
    @Override
    public XmlGenerateAbstract generateXmlTemplate() throws Exception {
        XmlBuild xmlBuild = new XmlBuild();
        xmlBuild.generateRootNode("html");
        xmlBuild.setCurrentNodeH5Param(" lang=\"en\"");
        xmlBuild.generateChildNode("head");
        xmlBuild.setCurrentNodeToChildNodeByNodeName("head");

        xmlBuild.generateChildNode("meta");
        xmlBuild.setCurrentNodeToChildNodeByNodeName("meta");
        xmlBuild.setCurrentNodeH5Param(" charset=\"UTF-8\"");
        xmlBuild.changeCurrentNodeToParentNode();
        xmlBuild.generateChildNode("title");

        xmlBuild.changeCurrentNodeToParentNode();
        xmlBuild.changeCurrentNodeToParentNode();

        xmlBuild.generateChildNode("body");
        xmlBuild.setCurrentNodeToChildNodeByNodeName("body");

        xmlBuild.generateChildNode("table");
        xmlBuild.setCurrentNodeToChildNodeByNodeName("table");
        xmlBuild.setCurrentNodeH5Param(" border=\"1px\" width=\"800px\"  align=\"center\" cellspacing=\"3px\" cellpadding=\"15px\"");



        return xmlBuild;
    }
}
